from order_delivery import do_deliver_orders
from uo_player import UOPlayer
from gump_parser import parse_runebook_gump
import time
from AutoComplete import *
def main():
    while True:
        do_deliver_orders()
        time.sleep(1)
    #a, b =UOPlayer.MoveToPosition(2169, 2170, 7)
    #Player.Walk("NorthWest")
if __name__ == "__main__":
    main() 

"""
runebook_gump_id = 0x554b87f3
    
    # Per user suggestion, check if gump is already open.
    if Gumps.CurrentGump() != runebook_gump_id:
        Items.UseItem(0x48BE9122)
        Gumps.WaitForGump(runebook_gump_id, 10000)

    # Convert to a standard Python list immediately. This is crucial because
    # the object from Gumps is a .NET List which lacks some Python methods
    # (like .index()) and can cause concurrency errors.
    gump_lines = list(Gumps.LastGumpGetLineList())
    
    parsed_locations = parse_runebook_gump(gump_lines)

    print("--- Parsed Locations ---")
    for loc in parsed_locations:
        # Print the final, simplified location data
        print(f"Index: {loc['index']}, ButtonID: {loc['button_id']}, Type: {loc['type']:<8} Name: {loc['name']}")
"""